<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}" media="all">
    <script type="text/javascript" th:src="@{/layui/layui.js}"></script>
    <script type="text/javascript" th:src="@{/js/jquery-3.3.1.min.js}"></script>
    <!-- config set stop-writes-on-bgsave-error no-->
</head>

<div class="layui-layout layui-layout-admin">
    <body class="layui-layout-body">
    <input id="uid" type="hidden" th:value="${session.user.id}"/>
    <input id="adviceMsg" type="hidden" th:value="${adviceMsg}"/>
    <!-- 顶部商品开始 -->
    <div class="layui-header">
        <div class="layui-logo">商品管理系统之用户界面</div>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img th:src="@{/images/img.jpeg}" class="layui-nav-img">
                    <span th:text="${session.user.nickName}"></span>
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="/account/logout">退出系统</a></dd>
                </dl>
            </li>
        </ul>
    </div>

    <!-- 顶部商品结束 -->

    <!-- 左侧商品开始 -->
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">购物中心</a>
                    <dl class="layui-nav-child">
                        <dd class="layui-this"><a id="commodity_home" href="javascript:void(0)">商品主页</a></dd>
                        <dd><a id="my_order" href="javascript:void(0)">我的订单</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">个人中心</a>
                    <dl class="layui-nav-child">
                        <dd><a id="user_update" href="javascript:void(0)">个人信息</a></dd>
                        <dd><a id="advice">意见反馈</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>
    <!-- 左侧商品结束 -->

    <!-- 主体开始 -->
    <div class="layui-body">

        <iframe src="/account/redirect/commodity_home" style="width: 100%;height: 100%;border: 0px"></iframe>

    </div>
    <!-- 主体结束 -->

    <!-- 底部开始 -->
    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © YHSimon
    </div>
    <!-- 底部结束 -->
    </body>
</div>
<script type="text/javascript">
    var uid=$('#uid').val();
    $(function () {
        $("#commodity_home").click(function () {
            $("iframe").attr("src", "/account/redirect/commodity_home");
        });
        $("#my_order").click(function () {
            $("iframe").attr("src", "/account/redirect/order");
        });
        $("#user_update").click(function () {
            $("iframe").attr("src", "/user/findById2/"+uid);
        });
    });

    layui.use([ 'layer', 'table',  "laypage","jquery"], function() {
        var
            layer = layui.layer //弹层
            , table = layui.table //表格
            , laypage = layui.laypage //分页
            , $ = layui.jquery;

        $('#advice').on("click", function () {
            var adviceMsg=$('#adviceMsg').val();
            layer.open({
                //调整弹框的大小
                area: ['500px', '300px'],
                shadeClose: true,//点击旁边地方自动关闭
                //动画
                anim: 2,
                //弹出层的基本类型
                type: 2,
                //刚才定义的弹窗页面
                content: 'user_advice.html',
                title: '意见采集'

            });
        });
    });


</script>
<script>
    //二级商品联动
    layui.use('element', function () {
        var element = layui.element;

    });


</script>
</body>
</html>